//package com.example.demo.config;
//
//import lombok.SneakyThrows;
//import org.springframework.context.ApplicationContextInitializer;
//import org.springframework.context.ConfigurableApplicationContext;
//
//import java.io.File;
//
///**
// * @author 张述江
// * @date 2023-08-24
// */
//public class TestApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
//    @SneakyThrows
//    @Override
//    public void initialize(ConfigurableApplicationContext applicationContext) {
//        System.out.println("[ApplicationContextInitializer]");
//        String jarPath = new File("lib", "demo1-spring-boot-starter-1.0.0-all.jar").getCanonicalPath();
//
//        ClassLoader classLoader = applicationContext.getClassLoader();
//        ModuleClassLoader instance = ModuleClassLoader.getInstance(classLoader);
//        instance.loadClasspath(jarPath);
//        applicationContext.setClassLoader(instance);
//        Class.forName("com.example.demo1.config.Demo1AutoConfiguration");
//    }
//}
